
import java.math.BigInteger;

public class e016 {
    public static void main(String[] args) {
        long sTime = System.currentTimeMillis();
	BigInteger e = new BigInteger("2");
	e = e.pow(1000);
        String l = e.toString();
        int sum = 0;
        for (int i = 0; i < l.length(); i++) {
            int n = Integer.parseInt(String.valueOf(l.charAt(i)));
            sum += n;
        }
        System.out.println(sum);
        long fTime = System.currentTimeMillis();
        System.out.println("Time: " + (fTime - sTime) + "ms");
    }
}